package com.kitty.game.hunqi;

import com.kitty.game.FieldValuePosConst;
import com.kitty.game.attribute.AttrService;
import com.kitty.game.config.RoleDaofa;
import com.kitty.game.equip.message.RespNotifyMiscEx;
import com.kitty.game.equip.model.RoleEquip;
import com.kitty.game.equip.service.EquipService;
import com.kitty.game.fight.SkillConst;
import com.kitty.game.fight.artifact.passive.ArtifactType;
import com.kitty.game.fight.bean.FightObject;
import com.kitty.game.fight.bean.SuperBossFightObject;
import com.kitty.game.fight.message.RespSyncMessage;
import com.kitty.game.role.model.Role;
import com.kitty.game.utils.AsktaoUtil;
import com.kitty.game.utils.Const;
import com.kitty.mina.cache.DataCache;
import com.kitty.mina.message.MessagePusher;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

/**
 * 魂器
 */
@Service
public class HunQiService {
    @Autowired
    Dao dao;
    @Autowired
    AttrService attrService;
    @Autowired
    EquipService equipService;
    /**
     * 返回魂器特殊技能ID 没有魂器或者没有特殊技能返回0
     */
    public int getSpecialSkillId(FightObject player) {
        if (!player.isPlayer()) {
            return 0;
        }
        return getSpecialSkillId(player.getRole());
    }

    public int getSpecialSkillId(Role player) {
        /**取出身上携带的元宝*/
        RoleEquip hunqi = null;
        short equipPage = player.getEquipPage();
        hunqi = equipService.getRoleEquipByPos(player, Const.TALISMAN);
        if (hunqi == null || !hunqi.isHunQi()) {
            return 0;//如果不是魂器或者 没有法宝 返回0
        }
        String name = hunqi.getName();
        if(name.contains("锋芒")){
            return 1;
        }
        if(name.contains("魂灯")){
            return 2;
        }
        if(name.contains("鬼步")){
            return 3;
        }
        if(name.contains("润泽")){
            return 4;
        }
        if(name.contains("薄暮")){
            return 5;
        }
        if(name.contains("轮回")){
            return 6;
        }
        if(name.contains("伏虎")){
            return 7;
        }
        if(name.contains("双极")){
            return 8;
        }
        if(name.contains("灵咒")){
            return 9;
        }
        return 0;
    }


}
